package com.explorex.infra.puma.gateway.netty.common.enums;

public enum EnumUserStatus {
    UNRECOGNIZED(-1, "unrecognized"),
    ONLINE(1, "online"),
    OFFLINE(2, "offline"),
    BACK_GROUND(3, "background"),
    DAEMON(4, "daemon");

    private int key;
    private String value;

    private EnumUserStatus(int key, String desc) {
        this.key = key;
        this.value = desc;
    }

    public static EnumUserStatus getUserStatus(Integer userStatus) {
        if (userStatus == null) {
            return UNRECOGNIZED;
        } else {
            switch(userStatus) {
            case 1:
                return ONLINE;
            case 2:
                return OFFLINE;
            case 3:
                return BACK_GROUND;
            default:
                return UNRECOGNIZED;
            }
        }
    }

    private EnumUserStatus() {
    }

    public int getKey() {
        return this.key;
    }

    public String getValue() {
        return this.value;
    }
}
